/**
 * 
 */
package fpt.pits.blo;

import fpt.pits.dao.DepartmentInfoDAO;
import fpt.pits.dao.CourseApplicationInfoDAO;
import fpt.pits.dao.CourseDatabaseInfoDAO;
import fpt.pits.dao.CourseExpInfoDAO;
import fpt.pits.dao.CourseFrameworkInfoDAO;
import fpt.pits.dao.CourseInfoDAO;
import fpt.pits.dao.CourseLanguageInfoDAO;
import fpt.pits.dao.CourseTechnologyInfoDAO;
import fpt.pits.dto.CourseInfo;

/**
 * @author yoyosakura
 *
 */
public class CourseInfoBLO {
    private CourseInfoDAO courseDAO = new CourseInfoDAO();
    private DepartmentInfoDAO departmentDAO = new DepartmentInfoDAO();
    private CourseApplicationInfoDAO caDAO = new CourseApplicationInfoDAO();
    private CourseDatabaseInfoDAO cdDAO = new CourseDatabaseInfoDAO();
    private CourseFrameworkInfoDAO cfDAO = new CourseFrameworkInfoDAO();
    private CourseLanguageInfoDAO clDAO = new CourseLanguageInfoDAO();
    private CourseTechnologyInfoDAO ctDAO = new CourseTechnologyInfoDAO();
    private CourseExpInfoDAO ceDAO = new CourseExpInfoDAO();
    
    /**
     * 
     * @param courseName
     * @return
     */
    public CourseInfo get(String courseName) {
        CourseInfo courseInfo = courseDAO.get(courseName);
        courseInfo.setDepartment(departmentDAO.get(courseInfo.getDepartID()));
        courseInfo.setCaList(caDAO.getByCourseID(courseInfo.getCourseID()));
        courseInfo.setCdList(cdDAO.getByCourseID(courseInfo.getCourseID()));
        courseInfo.setCfList(cfDAO.getByCourseID(courseInfo.getCourseID()));
        courseInfo.setClList(clDAO.getByCourseID(courseInfo.getCourseID()));
        courseInfo.setCtList(ctDAO.getByCourseID(courseInfo.getCourseID()));
        courseInfo.setCeList(ceDAO.getByCourseID(courseInfo.getCourseID()));
        
        return courseInfo;
    }
}
